home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 12
/
CU Amiga Magazine's Super CD-ROM 12 (1997)(EMAP Images)(GB)[!][issue 1997-07].iso
/
CUCD
/
Games
/
DestructivePoker
/
sources
/
sources.lha
/
double.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-13
|
2KB
|
108 lines
/*
double.h (tuplaus)
V1.00 - 241196 Kimmo Teräväinen
----- ------ ----------------
V0.10 260197 started from TBetPrefsDialog
V0.20 260197 Double Dialog done (Amiga version tested).
V0.21 310197 Windows version tested.
*/
#ifndef DC1_POKER_DOUBLE
#define DC1_POKER_DOUBLE
#include "game.h"
#ifdef _Windows
class TDoubleDialog : public TDialog {
cGamePoker *game;
int win;
cIMGCard *card;
public:
TDoubleDialog(cGamePoker *ngame,TWindow *parent,int Win) :
TDialog(parent,DIALOG_DOUBLE,0),
win(Win),
game(ngame),
card(NULL)
{}
void SetupWindow();
virtual ~TDoubleDialog() {
DeleteCard();
game->Money_Add(win); // pay pot on exit
Destroy();
}
void CreateCard() {
int id=rand()%(52+game->Jokers());
if(card) DeleteCard();
card=new cIMGCard(this,game->Gfx(),cPoint(150,30),cCard(id));
if(card) {
card->Turn_CoverDown();
card->Show();
}
else ButtonOK();
}
void DeleteCard() {
if(card) {
card->Hide();
delete card;
}
card=NULL;
}
void ButtonSmall() {
if(!card) ButtonOK();
card->Turn_CoverUp();
if(card->Num()<6 || card->Suit()==JOKER) {
win+=win;
this->MessageBox("Win Pot Doubled!","Poker Note!");
CreateCard();
return;
}
this->MessageBox("Win Pot Lost!","Poker Note!");
win=0;
CloseWindow();
}
void ButtonBig() {
if(!card) ButtonOK();
card->Turn_CoverUp();
if(card->Num()>6 || card->Suit()==JOKER) {
win+=win;
this->MessageBox("Win Pot Doubled!","Poker Note!");
CreateCard();
return;
}
this->MessageBox("Win Pot Lost!","Poker Note!");
win=0;
CloseWindow();
}
void ButtonOK() {
CloseWindow();
}
DECLARE_RESPONSE_TABLE(TDoubleDialog);
};
#else
class TDoubleDialog {
Window *parent;
cGamePoker *game;
int win;
public:
TDoubleDialog(cGamePoker *ngame,Window *Wnd,int Win) :
parent(Wnd), game(ngame), win(Win) {}
void Execute();
};
#endif
#endif